3.1213 \(\int \frac{1}{(a+b \tan (e+f x)) (c+d \tan (e+f x))} \, dx\)

Optimal. Leaf size=118 \[ \frac{x (a c-b d)}{\left (a^2+b^2\right ) \left (c^2+d^2\right )}+\frac{b^2 \log (a \cos (e+f x)+b \sin (e+f x))}{f \left (a^2+b^2\right ) (b c-a d)}-\frac{d^2 \log (c \cos (e+f x)+d \sin (e+f x))}{f \left (c^2+d^2\right ) (b c-a d)} \]

[Out]

((a*c - b*d)*x)/((a^2 + b^2)*(c^2 + d^2)) + (b^2*Log[a*Cos[e + f*x] + b*Sin[e + f*x]])/((a^2 + b^2)*(b*c - a*d
)*f) - (d^2*Log[c*Cos[e + f*x] + d*Sin[e + f*x]])/((b*c - a*d)*(c^2 + d^2)*f)

________________________________________________________________________________________

Rubi [A]  time = 0.145215, antiderivative size = 118, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 25, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.08, Rules used = {3571, 3530} \[ \frac{x (a c-b d)}{\left (a^2+b^2\right ) \left (c^2+d^2\right )}+\frac{b^2 \log (a \cos (e+f x)+b \sin (e+f x))}{f \left (a^2+b^2\right ) (b c-a d)}-\frac{d^2 \log (c \cos (e+f x)+d \sin (e+f x))}{f \left (c^2+d^2\right ) (b c-a d)} \]

Antiderivative was successfully verified.

[In]

Int[1/((a + b*Tan[e + f*x])*(c + d*Tan[e + f*x])),x]

[Out]

((a*c - b*d)*x)/((a^2 + b^2)*(c^2 + d^2)) + (b^2*Log[a*Cos[e + f*x] + b*Sin[e + f*x]])/((a^2 + b^2)*(b*c - a*d
)*f) - (d^2*Log[c*Cos[e + f*x] + d*Sin[e + f*x]])/((b*c - a*d)*(c^2 + d^2)*f)

Rule 3571

Int[1/(((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])), x_Symbol] :> Simp[((a*
c - b*d)*x)/((a^2 + b^2)*(c^2 + d^2)), x] + (Dist[b^2/((b*c - a*d)*(a^2 + b^2)), Int[(b - a*Tan[e + f*x])/(a +
 b*Tan[e + f*x]), x], x] - Dist[d^2/((b*c - a*d)*(c^2 + d^2)), Int[(d - c*Tan[e + f*x])/(c + d*Tan[e + f*x]),
x], x]) /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0]

Rule 3530

Int[((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(c*Log[Re
moveContent[a*Cos[e + f*x] + b*Sin[e + f*x], x]])/(b*f), x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d,
0] && NeQ[a^2 + b^2, 0] && EqQ[a*c + b*d, 0]

Rubi steps

\begin{align*} \int \frac{1}{(a+b \tan (e+f x)) (c+d \tan (e+f x))} \, dx &=\frac{(a c-b d) x}{\left (a^2+b^2\right ) \left (c^2+d^2\right )}+\frac{b^2 \int \frac{b-a \tan (e+f x)}{a+b \tan (e+f x)} \, dx}{\left (a^2+b^2\right ) (b c-a d)}-\frac{d^2 \int \frac{d-c \tan (e+f x)}{c+d \tan (e+f x)} \, dx}{(b c-a d) \left (c^2+d^2\right )}\\ &=\frac{(a c-b d) x}{\left (a^2+b^2\right ) \left (c^2+d^2\right )}+\frac{b^2 \log (a \cos (e+f x)+b \sin (e+f x))}{\left (a^2+b^2\right ) (b c-a d) f}-\frac{d^2 \log (c \cos (e+f x)+d \sin (e+f x))}{(b c-a d) \left (c^2+d^2\right ) f}\\ \end{align*}

Mathematica [C]  time = 0.295931, size = 143, normalized size = 1.21 \[ \frac{\frac{2 b^2 \log (a+b \tan (e+f x))}{\left (a^2+b^2\right ) (b c-a d)}+\frac{2 d^2 \log (c+d \tan (e+f x))}{\left (c^2+d^2\right ) (a d-b c)}+\frac{\log (-\tan (e+f x)+i)}{(a+i b) (-d+i c)}-\frac{\log (\tan (e+f x)+i)}{(b+i a) (c-i d)}}{2 f} \]

Antiderivative was successfully verified.

[In]

Integrate[1/((a + b*Tan[e + f*x])*(c + d*Tan[e + f*x])),x]

[Out]

(Log[I - Tan[e + f*x]]/((a + I*b)*(I*c - d)) - Log[I + Tan[e + f*x]]/((I*a + b)*(c - I*d)) + (2*b^2*Log[a + b*
Tan[e + f*x]])/((a^2 + b^2)*(b*c - a*d)) + (2*d^2*Log[c + d*Tan[e + f*x]])/((-(b*c) + a*d)*(c^2 + d^2)))/(2*f)

________________________________________________________________________________________

Maple [A]  time = 0.039, size = 212, normalized size = 1.8 \begin{align*} -{\frac{\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) ad}{2\,f \left ({a}^{2}+{b}^{2} \right ) \left ({c}^{2}+{d}^{2} \right ) }}-{\frac{\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) bc}{2\,f \left ({a}^{2}+{b}^{2} \right ) \left ({c}^{2}+{d}^{2} \right ) }}+{\frac{\arctan \left ( \tan \left ( fx+e \right ) \right ) ac}{f \left ({a}^{2}+{b}^{2} \right ) \left ({c}^{2}+{d}^{2} \right ) }}-{\frac{\arctan \left ( \tan \left ( fx+e \right ) \right ) bd}{f \left ({a}^{2}+{b}^{2} \right ) \left ({c}^{2}+{d}^{2} \right ) }}+{\frac{{d}^{2}\ln \left ( c+d\tan \left ( fx+e \right ) \right ) }{f \left ( ad-bc \right ) \left ({c}^{2}+{d}^{2} \right ) }}-{\frac{{b}^{2}\ln \left ( a+b\tan \left ( fx+e \right ) \right ) }{f \left ({a}^{2}+{b}^{2} \right ) \left ( ad-bc \right ) }} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(a+b*tan(f*x+e))/(c+d*tan(f*x+e)),x)

[Out]

-1/2/f/(a^2+b^2)/(c^2+d^2)*ln(1+tan(f*x+e)^2)*a*d-1/2/f/(a^2+b^2)/(c^2+d^2)*ln(1+tan(f*x+e)^2)*b*c+1/f/(a^2+b^
2)/(c^2+d^2)*arctan(tan(f*x+e))*a*c-1/f/(a^2+b^2)/(c^2+d^2)*arctan(tan(f*x+e))*b*d+1/f*d^2/(a*d-b*c)/(c^2+d^2)
*ln(c+d*tan(f*x+e))-1/f*b^2/(a^2+b^2)/(a*d-b*c)*ln(a+b*tan(f*x+e))

________________________________________________________________________________________

Maxima [A]  time = 1.73128, size = 238, normalized size = 2.02 \begin{align*} \frac{\frac{2 \, b^{2} \log \left (b \tan \left (f x + e\right ) + a\right )}{{\left (a^{2} b + b^{3}\right )} c -{\left (a^{3} + a b^{2}\right )} d} - \frac{2 \, d^{2} \log \left (d \tan \left (f x + e\right ) + c\right )}{b c^{3} - a c^{2} d + b c d^{2} - a d^{3}} + \frac{2 \,{\left (a c - b d\right )}{\left (f x + e\right )}}{{\left (a^{2} + b^{2}\right )} c^{2} +{\left (a^{2} + b^{2}\right )} d^{2}} - \frac{{\left (b c + a d\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{{\left (a^{2} + b^{2}\right )} c^{2} +{\left (a^{2} + b^{2}\right )} d^{2}}}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+b*tan(f*x+e))/(c+d*tan(f*x+e)),x, algorithm="maxima")

[Out]

1/2*(2*b^2*log(b*tan(f*x + e) + a)/((a^2*b + b^3)*c - (a^3 + a*b^2)*d) - 2*d^2*log(d*tan(f*x + e) + c)/(b*c^3
- a*c^2*d + b*c*d^2 - a*d^3) + 2*(a*c - b*d)*(f*x + e)/((a^2 + b^2)*c^2 + (a^2 + b^2)*d^2) - (b*c + a*d)*log(t
an(f*x + e)^2 + 1)/((a^2 + b^2)*c^2 + (a^2 + b^2)*d^2))/f

________________________________________________________________________________________

Fricas [A]  time = 1.91433, size = 443, normalized size = 3.75 \begin{align*} -\frac{{\left (a^{2} + b^{2}\right )} d^{2} \log \left (\frac{d^{2} \tan \left (f x + e\right )^{2} + 2 \, c d \tan \left (f x + e\right ) + c^{2}}{\tan \left (f x + e\right )^{2} + 1}\right ) - 2 \,{\left (a b c^{2} + a b d^{2} -{\left (a^{2} + b^{2}\right )} c d\right )} f x -{\left (b^{2} c^{2} + b^{2} d^{2}\right )} \log \left (\frac{b^{2} \tan \left (f x + e\right )^{2} + 2 \, a b \tan \left (f x + e\right ) + a^{2}}{\tan \left (f x + e\right )^{2} + 1}\right )}{2 \,{\left ({\left (a^{2} b + b^{3}\right )} c^{3} -{\left (a^{3} + a b^{2}\right )} c^{2} d +{\left (a^{2} b + b^{3}\right )} c d^{2} -{\left (a^{3} + a b^{2}\right )} d^{3}\right )} f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+b*tan(f*x+e))/(c+d*tan(f*x+e)),x, algorithm="fricas")

[Out]

-1/2*((a^2 + b^2)*d^2*log((d^2*tan(f*x + e)^2 + 2*c*d*tan(f*x + e) + c^2)/(tan(f*x + e)^2 + 1)) - 2*(a*b*c^2 +
 a*b*d^2 - (a^2 + b^2)*c*d)*f*x - (b^2*c^2 + b^2*d^2)*log((b^2*tan(f*x + e)^2 + 2*a*b*tan(f*x + e) + a^2)/(tan
(f*x + e)^2 + 1)))/(((a^2*b + b^3)*c^3 - (a^3 + a*b^2)*c^2*d + (a^2*b + b^3)*c*d^2 - (a^3 + a*b^2)*d^3)*f)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+b*tan(f*x+e))/(c+d*tan(f*x+e)),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [A]  time = 1.38046, size = 271, normalized size = 2.3 \begin{align*} \frac{\frac{2 \, b^{3} \log \left ({\left | b \tan \left (f x + e\right ) + a \right |}\right )}{a^{2} b^{2} c + b^{4} c - a^{3} b d - a b^{3} d} - \frac{2 \, d^{3} \log \left ({\left | d \tan \left (f x + e\right ) + c \right |}\right )}{b c^{3} d - a c^{2} d^{2} + b c d^{3} - a d^{4}} + \frac{2 \,{\left (a c - b d\right )}{\left (f x + e\right )}}{a^{2} c^{2} + b^{2} c^{2} + a^{2} d^{2} + b^{2} d^{2}} - \frac{{\left (b c + a d\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{a^{2} c^{2} + b^{2} c^{2} + a^{2} d^{2} + b^{2} d^{2}}}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+b*tan(f*x+e))/(c+d*tan(f*x+e)),x, algorithm="giac")

[Out]

1/2*(2*b^3*log(abs(b*tan(f*x + e) + a))/(a^2*b^2*c + b^4*c - a^3*b*d - a*b^3*d) - 2*d^3*log(abs(d*tan(f*x + e)
 + c))/(b*c^3*d - a*c^2*d^2 + b*c*d^3 - a*d^4) + 2*(a*c - b*d)*(f*x + e)/(a^2*c^2 + b^2*c^2 + a^2*d^2 + b^2*d^
2) - (b*c + a*d)*log(tan(f*x + e)^2 + 1)/(a^2*c^2 + b^2*c^2 + a^2*d^2 + b^2*d^2))/f